<template>
  <van-popup
    v-bind="$attrs"
    v-on="$listeners"
    get-container="body">
    <div class="modal-inner" :style="{background: backColor}">
      <f7-link v-if="!hideCloseBtn" class="close-btn" @click="$emit('input', false)">
        <f7-icon f7="multiply" :style="{color: closeBtnColor}"></f7-icon>
      </f7-link>
      <slot></slot>
    </div>
  </van-popup>
</template>

<script>
  export default {
    name: "custom-modal",
    props: {
      backColor: {
        type: String,
        default: 'rgba(12,24,45,1)'
      },
      closeBtnColor: {
        type: String,
        default: '#4CB6D6'
      },
      hideCloseBtn: Boolean
    }
  }
</script>

<style scoped lang="scss">
  .modal-inner {
    width: 80%;
    min-height: 60px;
    /*background:rgba(12,24,45,1);*/
    border-radius:20px;
    margin: 0 auto;
    padding: 30px;
    position: relative;
    .close-btn {
      position: absolute;
      right: 20px;
      top: 20px;
      .icon {
        font-size: 40px;
      }
    }
  }
</style>